﻿//-----------------------------------------------------------------------
// <copyright file="DBVersion.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Using
using System;
using System.ComponentModel;
using System.Xml.Schema;
using System.Xml.Serialization;
#endregion

namespace GateShift.Tools.DatabaseMigration.Configuration
{
    /// <summary>
    /// Database Versioning Configuration Class
    /// </summary>
    [XmlType(TypeName = "version"), Serializable]
    [EditorBrowsable(EditorBrowsableState.Advanced)]
    public class DBVersion
    {
        /// <summary>
        /// Initializes a new instance of the DBVersion class
        /// </summary>
        public DBVersion()
        {
            ChangeSets = new ChangeSetCollection();
            Name = string.Empty;
            Value = string.Empty;
        }

        /// <summary>
        /// Gets or sets the name for the version
        /// </summary>
        [XmlAttribute(AttributeName = "name", DataType = "string")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the value for the version
        /// </summary>
        [XmlAttribute(AttributeName = "version", DataType = "string")]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public string Value { get; set; }

        /// <summary>
        /// Gets or sets the list of ShangeSets for the version
        /// </summary>
        [XmlElement(Type = typeof(ChangeSet), ElementName = "changeset", IsNullable = false, Form = XmlSchemaForm.Qualified)]
        [EditorBrowsable(EditorBrowsableState.Advanced)]
        public ChangeSetCollection ChangeSets { get; set; }
    }
}
